'use strict'
const path = require('path')
// const CompressionPlugin = require('compression-webpack-plugin')
// const defaultSettings = require('./src/settings.js')

function resolve(dir) {
    return path.join(__dirname, dir)
}

const name = 'document' // page title

const port = process.env.port || process.env.npm_config_port || 8080 // dev port

module.exports = {
    publicPath: './',
    outputDir: 'dist',
    assetsDir: 'static',
    lintOnSave: false,// process.env.NODE_ENV === 'development',
    productionSourceMap: false,
    devServer: {
        disableHostCheck: true,
        port: port,
        overlay: {
            warnings: false,
            errors: true
        },
        proxy: {
            '^/': {
                target: 'http://localhost:9004',
                changeOrigin: true,
                ws: true
            },
        }
    },
    configureWebpack: {
        devtool: 'source-map', //process.env.NODE_ENV === 'dev' ? 'source-map' : undefined,
        name: name,
        resolve: {
            alias: {
                '@': resolve('src')
            }
        }
    }
}
